package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.CRecommendhistoryDao;
import com.xyz.domain.table.CRecommendhistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CRecommendhistoryLogic {

    @Autowired
    private CRecommendhistoryDao cRecommendhistoryDao;

    public CRecommendhistory add(CRecommendhistory cRecommendhistory){
        return cRecommendhistoryDao.insert(cRecommendhistory);
    }

    public Integer update(CRecommendhistory cRecommendhistory){
        return cRecommendhistoryDao.update(cRecommendhistory);
    }

    public List<CRecommendhistory> list(CRecommendhistory cRecommendhistory, String orderBy){
        return cRecommendhistoryDao.selectList(cRecommendhistory, orderBy);
    }

    public Integer delete(Integer key){
        return cRecommendhistoryDao.delete(key);
    }

    public PageResponseModel<CRecommendhistory> pageInfo(CRecommendhistory cRecommendhistory, String orderBy, Integer pageNo, Integer pageSize){
        return cRecommendhistoryDao.selectByPageNo(cRecommendhistory, orderBy, pageNo, pageSize);
    }

}